package com.guyj.baseproject;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.guyj.baseproject.designpatterns.build.Computer;
import com.guyj.baseproject.designpatterns.observer.MyObservable;
import com.guyj.baseproject.designpatterns.observer.MyObserver;
import com.guyj.lib_common.utils.LogUtils;

public class MainActivity extends AppCompatActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		//		DialogManager.getInstance().showAAADialog(this, orientation -> {
		//			switch (orientation){
		//				case ALERT_LEFT:
		//					LogUtils.e("left");
		//					break;
		//				case ALERT_RIGHT:
		//					LogUtils.e("right");
		//					break;
		//			}
		//		});

		MyObserver observer1 = new MyObserver("1");
		MyObserver observer2 = new MyObserver("2");
		MyObservable myObservable1 = new MyObservable("AAA");
		myObservable1.addObserver(observer1);
		myObservable1.addObserver(observer2);

		myObservable1.changeWord("aaaaa");

		Computer computer = new Computer.Builder().setCPU("intel i7").setMemory("16g").setGraphicsCard("GTX 2060").create();
		Computer computer1 = new Computer.Builder().create();
		LogUtils.i(computer.toString());
		LogUtils.i(computer1.toString());

	}
}
